<?php !defined('DYHB_PATH') && exit; /* DoYouHaoBaby Framework 模板缓存文件 生成时间：2011-05-31 22:21:15  */ ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>DoYouHaoBaby示例：CURD操作</title>
<link rel='stylesheet' type='text/css' href='__PUBLIC__/css/common.css'>
<script type="text/javascript" src="<?php echo __LIBCOM__;?>/Js/Vendor/Jquery.js"></script>
<script type="text/javascript" src="<?php echo __LIBCOM__;?>/Js/Dyhb.package.js"></script>
 </head>
 <body>

<script type="text/javascript">
 <!--
	function add(){

		window.location.href="__URL__/add";
	}
	function edit(id){

		window.location.href="__URL__/edit/id/"+id;
	}
	function del(id){

		Dyhb.AjaxSend('__URL__/del','ajax=1&id='+id,'result',complete);
	}
	function complete(data,status){

		if (status==1){

			$('#data_'+data.form_id).hide(3000);
		}
	}
 //-->
</script>

 <div class="main">
 <h2>DoYouHaoBaby示例之：CURD操作</h2>
<div class="title">方便地完成对单表的CURD操作</div>
<p>
<input type="button" value="新 增" class="small" onClick="add()"><div id="result" class="none result" style="font-family:微软雅黑,Tahoma;letter-spacing:2px"></div></div></p>
<div class="line"></div>
<div class="article_list">
<div class="title">文章列表</div>
<ul id="list">
<?php $i=1 ;?>
<?php if( is_array( $arrObjectList ) ) : foreach( $arrObjectList as $key=>$value): ?>

  <li id="data_<?php echo( $value->form_id ); ?>">
	<div class="article_title"><?php echo( $value->form_title ); ?></div><div class="article_detail">[<?php echo( $value->form_email ); ?> <?php echo( date( 'Y-m-d H:i:s',$value->create_date ) ); ?>]<br/>
	<input type="button" value="编辑" class="small button" onClick="edit(<?php echo( $value->form_id ); ?>)"> <input type="button" value="删除" class="small button" onClick="del(<?php echo( $value->form_id ); ?>)"></div>
    <div class="content"><?php echo( $value->form_content ); ?></div>
  </li>

<?php $i++ ;?>
<?php endforeach;endif; ?>
</ul>
</div>

<div class="line"></div>
 <div class="title">示例源码</div><br/><div class="li_title">控制器IndexControl类</div><br/>
 <div class="code"><?php highlight_file( APP_LIB_PATH.'/Action/IndexController.class.php') ?></div><br/>
 <div class="li_title">模型FormModel类</div><br/>
 <div class="code"><?php highlight_file( APP_LIB_PATH.'/Model/FormModel.class.php') ?>
 </div>
</div>
 </body>
</html>
